export function mapPermissions(userMenu: any[]) {
  const userPermissions: string[] = []

  function permissionsType(menu: any[]) {
    for (const item of menu) {
      if (item.type === 3) {
        userPermissions.push(item.permission)
      } else {
        permissionsType(item.children ?? [])
      }
    }
  }

  permissionsType(userMenu)
  return userPermissions
}
